<style lang="less">
    .mb20 {
        margin-bottom: 20px;
    }
    .ivu-table td.demo-table-info-column{
        background-color: #FFFACD;
        color: #fff;
    }
    .bench_search {
      margin-bottom: 10px;
    }
    .demo-spin-col{
      height: 100px;
      position: relative;
    }
    .demo-spin-icon-load{
      animation: ani-demo-spin 1s linear infinite;
    }
    .opt-area-02 {
        display: flex;
        align-items: center;
        flex-direction: column;
        border: 1px solid #abdcff;
        background-color: #f0faff;
        padding: 8px 16px 8px 16px;
        border-radius: 4px;
        margin-bottom: 10px;
    }
    .opt-area-02 .right-con {
        width: 100%;
        margin-top: 5px;
        display: flex;
    }

    .opt-area-02 .left-con {
        font-size: 14px;
        width: 100%;
    }

    .opt-area-02 .left-con span {
        font-weight: bold;
    }

    .opt-area-02 .right-con input {
        width: 164px;
        margin-right: 10px;
    }

    .opt-area-02 .right-con .input-frame {
        width: 164px;
        margin-right: 10px;
    }
    .opt-area-02 .right-con .span-frame {
        width: 80px;
        margin-right: 10px;
    }
</style>

<template>
    <div>
      <div class="opt-area-02">
        <div class="right-con">
          <div class="input-frame">
              <Input type="text"  placeholder="请输入姓名" style="width: 164px" v-model="searchInfo.name" icon="ios-search"/>
          </div>
          <div class="input-frame" style="width: 164px">
            <Select v-model="searchInfo.subsidy_type" placeholder="请选择补贴类型" transfer="" style="width: 164px;">
                <Option value="护理补贴">重度残疾人护理补贴</Option>
                <Option value="生活补贴">困难残疾人生活补贴</Option>
            </Select>
          </div>
            <div class="input-frame" style="width: 164px" v-if="companyCode==='LM'">
                <Select v-model="searchInfo.county" placeholder="请选择区域" transfer="" style="width: 164px;">
                    <Option v-for="item in code" :value="item.title" :key="item.company_code">{{item.title}}</Option>
                </Select>
            </div>
          <Button type="info" size="small" @click="search(1)" style="margin-right: 5px;width:100px">搜索在册人员</Button>
          <Button type="info" size="small" @click="searchYDSJ(1)" v-if="companyCode==='LM'" style="margin-right: 5px;width:100px">搜索疑点数据</Button>
          <Button type="info" size="small" @click="check()" style="margin-right: 5px;width:80px" v-if="bind_seller_login_code != 'LM07' && bind_seller_login_code != 'LM2249415'">核查</Button>
          <Button type="info" size="small" @click="refresh()" style="margin-right: 5px;width:60px">刷新</Button>
          <Button type="info" size="small" @click="doubt()" style="margin-right: 5px;width:80px">疑点数据</Button>
          <Button type="info" size="small" @click="exportData" style="margin-right: 5px;width:100px">导出疑点数据</Button>
<!--          <Button type="info" size="small" @click="Modal1 = true" style="margin-right: 5px;width:100px">导入在册数据</Button>-->
          <Button type="info" size="small" @click="searchPayableList()" style="margin-right: 5px;width:100px">可发放名单</Button>
          <Button type="primary" size="small" @click="clearData()">清空</Button>
        </div>
        <div class="right-con" v-if="loginName!=='LM07' && loginName!=='LM2249415'" style="margin-top:10px">
          <div class="span-frame">
            <span style="margin-top: 8px;text-align: center;" v-show="this.surplusCheckNum != 0">正在核查</span>
          </div>
          <div class="span-frame">
            <span style="margin-top: 8px;text-align: center" v-show="this.surplusCheckNum != 0">总数量：</span>
          </div>
          <div class="span-frame">
            <span style="margin-top: 8px;text-align: center" v-show="this.surplusCheckNum != 0">{{grantnum}}</span>
          </div>
          <div class="span-frame">
            <span style="margin-top: 8px;text-align: center" v-show="this.surplusCheckNum != 0">已核查：</span>
          </div>
          <div class="span-frame">
            <span style="margin-top: 8px;text-align: center" v-show="this.surplusCheckNum != 0">{{compoundnum}}</span>
          </div>
          <div class="span-frame">
            <span style="margin-top: 8px;text-align: center" v-show="this.surplusCheckNum != 0">剩余数量：</span>
          </div>
          <div class="span-frame">
            <span style="margin-top: 8px;text-align: center" v-show="this.surplusCheckNum != 0">{{grantnum - compoundnum}}</span>
          </div>
        </div>
        <div class="right-con" v-if="loginName == 'LM07' || loginName == 'LM2249415'" style="margin-top:10px">
          <Button type="info" size="small" @click="verification()" style="margin-right: 5px;margin-left:94%" v-if="loginName === 'LM07' || loginName == 'LM2249415'">核查情况</Button>
        </div>
      </div>
      <div>
        <Row>
          <Col span="1" class="ivu-form-item-label">共计：</Col>
          <Col span="1" class="ivu-form-item-label">{{totalnum}}</Col>
          <Col span="1" class="ivu-form-item-label">条</Col>
        </Row>
      </div>
      <div style="margin-top: 20px">
        <Table border :columns="columns12" :data="data6"  ref="table" >
            <template slot-scope="{ row }" slot="registerstr">
                <strong  v-if="row.registerstr!=='沈阳户籍'" style="color: red">{{ row.registerstr }}</strong>
                <strong  v-if="row.registerstr==='沈阳户籍'" style="color: black">{{ row.registerstr }}</strong>
            </template>
            <template slot-scope="{ row }" slot="allowanceskind">
                <strong  v-if="row.allowanceskind==='非保障户' && row.subsidy_type === '生活补贴' " style="color: red">{{ row.allowanceskind }}</strong>
                <strong  v-if="row.allowanceskind==='非保障户' && row.subsidy_type === '护理补贴' " style="color: black">{{ row.allowanceskind }}</strong>
                <strong  v-if="row.allowanceskind!=='非保障户' && row.subsidy_type === '护理补贴' " style="color: black">{{ row.allowanceskind }}</strong>
                <strong  v-if="row.allowanceskind!=='非保障户' && row.subsidy_type === '生活补贴' " style="color: black">{{ row.allowanceskind }}</strong>
            </template>
            <template slot-scope="{ row }" slot="disability_type">
                <strong  v-if="row.disability_state==='2'" style="color: red">调用失败</strong>
                <strong  v-if="row.disability_type==='非残疾人' && row.disability_state!=='2'" style="color: red">{{ row.disability_type }}</strong>
                <strong  v-if="row.disability_type!=='非残疾人' && row.disability_state!=='2'" style="color: black">{{ disabilityShow(row) }}</strong>
            </template>
            <template slot-scope="{ row }" slot="funeral_info">
                <strong  v-if="row.funeral_info==='1'" style="color: red">查询到该人员殡葬信息</strong>
                <strong  v-if="row.funeral_info==='3'" style="color: red">对方接口不允许调用</strong>
                <strong  v-if="row.funeral_info == '0'" style="color: black">未查询到该人员殡葬信息</strong>
                <strong  v-if="row.funeral_info == '2'" style="color: black">调用失败</strong>
            </template>
            <template slot-scope="{ row }" slot="occupational_info">
                <strong  v-if="row.occupational_info==='1'" style="color: red">领取工伤补贴人员</strong>
                <strong  v-if="row.occupational_info==='0'" style="color: black">非领取工伤补贴人员</strong>
                <strong  v-if="row.occupational_info==='2'" style="color: red">查询失败</strong>
                <strong  v-if="row.occupational_info==='3'" style="color: red">对方接口不允许调用</strong>
            </template>
            <template slot-scope="{ row }" slot="orphan_info">
                <strong  v-if="row.orphan_info==='1' && row.subsidy_type === '生活补贴' " style="color: red">孤儿</strong>
                <strong  v-if="row.orphan_info==='0' && row.subsidy_type === '生活补贴' " style="color: black">非孤儿</strong>
                <strong  v-if="row.subsidy_type === '护理补贴' " style="color: black">护理补贴是孤儿与否都满足条件</strong>
            </template>
            <template slot-scope="{ row }" slot="difficulty_info">
                <strong  v-if="row.difficulty_info==='0'" style="color: black ">非领取特困供养补贴人员</strong>
                <strong  v-if="row.difficulty_info==='1'" style="color: red">领取特困供养补贴人员</strong>
            </template>
            <template slot-scope="{ row }" slot="decease_info">
                <strong  v-if="row.decease_info==='0'" style="color: black ">未查询到死亡信息</strong>
                <strong  v-else-if="row.decease_info==='1'" style="color: red">死亡时间: {{row.decease}}</strong>
            </template>
            <template slot-scope="{ row }" slot="criminal_info">
                <strong  v-if="row.criminal_info==='0'" style="color: black ">非正在服刑人员</strong>
                <strong  v-else-if="row.criminal_info==='1'" style="color: red">查询到服刑信息{{row.criminal}}</strong>
            </template>
            <template slot-scope="{ row }" slot="action">
                <Button type="info" size="small"  @click="findinfo(row)">查看详情</Button>
            </template>
        </Table>
      </div>
      <div  class="page" style="margin-top: 20px;text-align: right">
          <Page :total="totalnum" :current="currentPageNo" :page-size="currentPageSize" @on-change="change" class="page_style"/>
      </div>
      <Modal v-model="Modal1" title="残疾人两项补贴在册人员上传" width="700" cancel-text="关闭" ok-text="确定" @on-cancel="Modal1=false">
        <Row class="bench_search">
          <Col span="3" class="ivu-form-item-label">上传文件：</Col>
          <Col span="4">
            <Upload action="http://dycup.tripln.top/api/ac/file/fileCommonService/upLoadFiles" :show-upload-list="false" :before-upload="beforeUploadPdf">
              <Button type="info" icon="ios-cloud-upload-outline" style="margin-right: 5px;width:100px">上传</Button>
            </Upload>
          </Col>
          <Col span="4" v-if="paramData.file_url != '' && paramData.file_url != undefined">
            <Button type="info" @click="saveEdit()" style="margin-left: 2px;width:100px">确定上传</Button>
          </Col>
          <Col span="4" >
            <Button type="info" @click="checkEdit()" style="margin-left: 2px;width:100px">数据对比</Button>
          </Col>
          <Col span="4" >
            <Button type="info" @click="addEdit()" style="margin-left: 2px;width:100px">更新数据</Button>
          </Col>
        </Row>
        <Row class="bench_search">
          <Col span="3" class="ivu-form-item-label">文件路径：</Col>
          <Col span="16" class="ivu-form-item-content">
            <Input v-model="paramData.file_url" disabled type="textarea" :autosize="{minRows: 1,maxRows: 4}"></Input>
          </Col>
        </Row>
        <Row class="bench_search" v-if="FileLoadData">
          <Col class="demo-spin-col" span="8" offset="8">
            <Spin fix v-if="loadData == true">
              <Icon type="ios-loading" size=18 class="demo-spin-icon-load"></Icon>
            </Spin>
            <Spin fix v-if="FileLoadData">
              <div style="width: 480px">{{ FileLoadData }}</div>
            </Spin>
          </Col>
        </Row>
      </Modal>
      <Modal v-model="show1" title="详细信息" @on-ok="ok1()" @on-cancel="show1===false" width="800">
          <Form label-position="right" :label-width="100" style="position: relative;">
              <Row class="mb20">
                  <Col span="17" class="ivu-form-item-label" style="font-size: 20px">辽宁省残疾人两项补贴情况表</Col>
              </Row>
              <Row class="mb20">
                  <Col span="6" class="ivu-form-item-label">姓名：</Col>
                  <Col span="4" class="ivu-form-item-content" ><Input v-model="mainmap.name" style="width: 150px"></Input></Col>
                  <Col span="5" class="ivu-form-item-label">性别：</Col>
                  <Col span="4" class="ivu-form-item-content" ><Input v-model="mainmap.sex" style="width: 150px"></Input></Col>
              </Row>
              <Row class="mb20">
                  <Col span="6" class="ivu-form-item-label">身份证号码：</Col>
                  <Col span="4"><Input v-model="mainmap.cardno" style="width: 150px"/></Col>
                  <Col span="5" class="ivu-form-item-label">残疾证号码：</Col>
                  <Col span="4"><Input v-model="mainmap.disability_certificate_number" style="width: 150px" /></Col>
              </Row>
              <Row class="mb20">
                  <Col span="6" class="ivu-form-item-label">残疾类别：</Col>
                  <Col span="4"><Input v-model="mainmap.disability_type" style="width: 150px"/></Col>
                  <Col span="5" class="ivu-form-item-label">残疾等级：</Col>
                  <Col span="4"><Input v-model="mainmap.disability_grade" style="width: 150px" /></Col>
              </Row>
              <Row class="mb20">
                  <Col span="6" class="ivu-form-item-label">户籍性质：</Col>
                  <Col span="4"><Input v-model="mainmap.household" style="width: 150px"/></Col>
                  <Col span="5" class="ivu-form-item-label">户籍地址：</Col>
                  <Col span="4"><Input v-model="mainmap.homeaddress" style="width: 150px" /></Col>
              </Row>
              <Row class="mb20">
                  <Col span="6" class="ivu-form-item-label">残疾人电话：</Col>
                  <Col span="4"><Input v-model="mainmap.disablility_phone" style="width: 150px"/></Col>
                  <Col span="5" class="ivu-form-item-label">家庭住址：</Col>
                  <Col span="4"><Input v-model="mainmap.homeaddress" style="width: 150px" /></Col>
              </Row>
              <Row class="mb20">
                  <Col span="6" class="ivu-form-item-label">联系人：</Col>
                  <Col span="4"><Input v-model="mainmap.name" style="width: 150px"/></Col>
                  <Col span="5" class="ivu-form-item-label">联系人电话：</Col>
                  <Col span="4"><Input v-model="mainmap.link_phone" style="width: 150px" /></Col>
              </Row>
              <Row class="mb20">
                  <Col span="6" class="ivu-form-item-label">补贴对象类型：</Col>
                  <Col span="4"><Input v-model="usermap.subsidy_person_type" style="width: 150px"/></Col>
                  <Col span="5" class="ivu-form-item-label">补贴类型：</Col>
                  <Col span="4"><Input v-model="usermap.subsidy_type" style="width: 150px" /></Col>
              </Row>
              <Row class="mb20">
                  <Col span="6" class="ivu-form-item-label">补贴金额：</Col>
                  <Col span="4"><Input v-model="usermap.subsidy_money" style="width: 150px"/></Col>
                  <Col span="5" class="ivu-form-item-label">发放起始月份：</Col>
                  <Col span="4"><Input v-model="usermap.grant_start_time" style="width: 150px" /></Col>
              </Row>
              <Row class="mb20">
                  <Col span="6" class="ivu-form-item-label">开户银行：</Col>
                  <Col span="4"><Input v-model="usermap.bank_name" style="width: 150px"/></Col>
                  <Col span="5" class="ivu-form-item-label">银行卡号：</Col>
                  <Col span="4"><Input v-model="usermap.bank_num" style="width: 150px" /></Col>
              </Row>
              <Row class="mb20">
                  <Col span="6" class="ivu-form-item-label">所属县区：</Col>
                  <Col span="4"><Input v-model="usermap.county" style="width: 150px"/></Col>
                  <Col span="5" class="ivu-form-item-label">所属乡镇：</Col>
                  <Col span="4"><Input v-model="usermap.township" style="width: 150px" /></Col>
              </Row>
          </Form>
      </Modal>
      <Modal v-model="verificationModal" title="核查情况" @on-ok="verificationModal == false" @on-cancel="verificationModal==false" width="800">
          <Form label-position="right" :label-width="100" style="position: relative;">
              <Row class="mb20">
                  <Col span="15" class="ivu-form-item-label" style="font-size: 20px">各区（县）核查情况</Col>
              </Row>
              <Row class="mb20">
                  <Col span="4" offset="2" class="ivu-form-item-label">已核查：</Col>
                  <Col span="6" class="ivu-form-item-content">
                    <div v-for="item in checkInfo.checkList" :key="item.city">
                      <span>{{item.city}}</span>
                    </div>
                  </Col>
                  <Col span="4" offset="2" class="ivu-form-item-label">未核查：</Col>
                  <Col span="6" class="ivu-form-item-content">
                    <div v-for="item in checkInfo.noCheckList" :key="item.city">
                      <span>{{item.city}}</span>
                    </div>
                  </Col>
              </Row>
          </Form>
      </Modal>
    </div>
</template>
<script>
import { createCheck, date2str, findAllCityList, findAllGrantUserList, findCheckList, findCompountList, findCompountMonthList, findNumUserd, getGrantNum, getMunicipalCompountList, getSubordinate, getUserInfo, PaymentAfterwards, RenewalCollar, updateStateByIdToStop, uploadPEXexle, addDisabledGridInfo, addDisabledInfo } from '@/api/stree'
import { createUpLoadFiles, getSign } from '@/api/common'
export default {
  data () {
    return {
      loginName: '',
      county: '',
      code: [],
      todayDate: '', // 当前日期（日）
      grantnum: 0, // 总数量
      compoundnum: 0, // 已核查数量
      surplusCheckNum: 0, // 剩余数量，
      num: 10,
      mainmap: {},
      usermap: {},
      infolist: [],
      sotinglist: [],
      select1: '',
      select2: '',
      statenum: '0',
      show1: false,
      Modal1: false,
      loadData: false,
      FileLoadData: '',
      name: '',
      cardno: '',
      model1: '',
      pageSize: 10,
      pageNo: 1,
      totalnum: 0,
      currentPageSize: 10,
      currentPageNo: 1,
      searchInfo: {},
      dateTime: [],
      dateTime1: [],
      columns12: [
        {
          title: '序号',
          type: 'index',
          width: 80,
          align: 'center'
        },
        {
          title: '区(县)',
          key: 'county',
          width: 100,
          align: 'center'
        },
        {
          title: '街道',
          key: 'township',
          width: 180,
          align: 'center'
        },
        {
          title: '姓名',
          key: 'name',
          width: 120,
          align: 'center'
        },
        {
          title: '身份证号',
          width: 200,
          key: 'cardno',
          align: 'center'
        },
        {
          title: '补贴对象类型',
          width: 210,
          key: 'subsidy_person_type',
          align: 'center'
        },
        {
          title: '补贴类型',
          width: 150,
          key: 'subsidy_type',
          align: 'center'
        },
        {
          title: '残疾类别',
          width: 200,
          key: 'disability_type',
          align: 'center'
        },
        {
          title: '残疾等级',
          width: 150,
          key: 'disability_grade',
          align: 'center'
        },
        {
          title: '补贴金额(元/月)',
          width: 130,
          key: 'subsidy_money',
          align: 'center'
        },
        {
          title: '发放起始时间',
          width: 150,
          key: 'grant_start_time',
          align: 'center'
        },
        {
          title: '发放截止时间',
          width: 150,
          key: 'grant_end_time',
          align: 'center'
        },
        // {
        //   title: '状态',
        //   width: 100,
        //   key: 'state',
        //   align: 'center'
        // },
        {
          title: '开户行',
          width: 100,
          key: 'bank_name',
          align: 'center'
        },
        {
          title: '账户名',
          width: 100,
          key: 'bank_people',
          align: 'center'
        },
        {
          title: '银行卡号',
          width: 150,
          key: 'bank_num',
          align: 'center'
        },
        {
          title: '残疾人证号',
          width: 150,
          key: 'disability_certificate_number',
          align: 'center'
        },
        {
          title: '性别',
          width: 150,
          key: 'sex',
          align: 'center'
        },
        {
          title: '户籍性质',
          width: 150,
          key: 'household',
          align: 'center'
        },
        {
          title: '家庭住址',
          width: 280,
          key: 'homeaddress',
          align: 'center'
        },
        {
          title: '民族',
          width: 150,
          key: 'nation',
          align: 'center'
        },
        {
          title: '残疾人电话',
          width: 150,
          key: 'disablility_phone',
          align: 'center'
        },
        {
          title: '联系人电话',
          width: 150,
          key: 'link_phone',
          align: 'center'
        },
        {
          title: '户籍情况',
          width: 150,
          slot: 'registerstr',
          align: 'center',
          className: 'demo-table-info-column'
        },
        {
          title: '低保情况',
          width: 150,
          slot: 'allowanceskind',
          align: 'center',
          className: 'demo-table-info-column'
        },
        {
          title: '残疾情况',
          width: 150,
          slot: 'disability_type',
          align: 'center',
          className: 'demo-table-info-column'
        },
        {
          title: '殡葬情况',
          width: 150,
          slot: 'funeral_info',
          align: 'center',
          className: 'demo-table-info-column'
        },
        {
          title: '孤儿情况',
          width: 150,
          slot: 'orphan_info',
          align: 'center',
          className: 'demo-table-info-column'
        },
        {
          title: '特困情况',
          width: 150,
          slot: 'difficulty_info',
          align: 'center',
          className: 'demo-table-info-column'
        },
        {
          title: '工伤情况',
          width: 150,
          slot: 'occupational_info',
          align: 'center',
          className: 'demo-table-info-column'
        },
        {
          title: '卫健死亡情况',
          width: 150,
          slot: 'decease_info',
          align: 'center',
          className: 'demo-table-info-column'
        },
        {
          title: '服刑情况',
          width: 150,
          slot: 'criminal_info',
          align: 'center',
          className: 'demo-table-info-column'
        },
        {
          title: '操作',
          slot: 'action',
          width: 150,
          align: 'center',
          fixed: 'right'
        }
      ],
      data6: [],
      presentSubsidyData: [],
      columns7: [
        {
          title: '序号',
          type: 'index',
          key: 'index',
          width: 60,
          align: 'center'
        },
        {
          title: '区(县)',
          key: 'county',
          width: 100,
          align: 'center'
        },
        {
          title: '街道',
          key: 'township',
          width: 150,
          align: 'center'
        },
        {
          title: '姓名',
          key: 'name',
          width: 120,
          align: 'center'
        },
        {
          title: '身份证号',
          width: 200,
          key: 'cardno',
          align: 'center'
        },
        {
          title: '补贴对象类型',
          width: 210,
          key: 'subsidy_person_type',
          align: 'center'
        },
        {
          title: '补贴类型',
          width: 150,
          key: 'subsidy_type',
          align: 'center'
        },
        {
          title: '残疾类别',
          width: 200,
          key: 'disability_type',
          align: 'center'
        },
        {
          title: '残疾等级',
          width: 150,
          key: 'disability_grade',
          align: 'center'
        },
        {
          title: '补贴金额(元/月)',
          width: 130,
          key: 'subsidy_money',
          align: 'center'
        },
        {
          title: '发放起始时间',
          width: 150,
          key: 'grant_start_time',
          align: 'center'
        },
        {
          title: '发放截止时间',
          width: 150,
          key: 'grant_end_time',
          align: 'center'
        },
        // {
        //   title: '状态',
        //   width: 100,
        //   key: 'state',
        //   align: 'center'
        // },
        {
          title: '开户行',
          width: 100,
          key: 'bank_name',
          align: 'center'
        },
        {
          title: '账户名',
          width: 100,
          key: 'bank_people',
          align: 'center'
        },
        {
          title: '银行卡号',
          width: 150,
          key: 'bank_num',
          align: 'center'
        },
        {
          title: '残疾人证号',
          width: 150,
          key: 'disability_certificate_number',
          align: 'center'
        },
        {
          title: '性别',
          width: 150,
          key: 'sex',
          align: 'center'
        },
        {
          title: '户籍性质',
          width: 150,
          key: 'household',
          align: 'center'
        },
        {
          title: '家庭住址',
          width: 150,
          key: 'homeaddress',
          align: 'center'
        },
        {
          title: '民族',
          width: 150,
          key: 'nation',
          align: 'center'
        },
        {
          title: '残疾人电话',
          width: 150,
          key: 'disablility_phone',
          align: 'center'
        },
        {
          title: '联系人电话',
          width: 150,
          key: 'link_phone',
          align: 'center'
        },
        {
          title: '户籍情况',
          width: 150,
          slot: 'registerstr',
          align: 'center',
          className: 'demo-table-info-column',
          key: 'registerstr'
        },
        {
          title: '低保情况',
          width: 150,
          slot: 'allowanceskind',
          align: 'center',
          className: 'demo-table-info-column',
          key: 'allowanceskind'
        },
        {
          title: '残疾情况',
          width: 150,
          slot: 'disability_type',
          align: 'center',
          className: 'demo-table-info-column',
          key: 'disability_type'
        },
        {
          title: '殡葬情况',
          width: 150,
          slot: 'funeral_info',
          align: 'center',
          className: 'demo-table-info-column',
          key: 'funeral_info'
        },
        {
          title: '孤儿情况',
          width: 150,
          slot: 'orphan_info',
          align: 'center',
          className: 'demo-table-info-column',
          key: 'orphan_info'
        },
        {
          title: '特困情况',
          width: 150,
          slot: 'difficulty_info',
          align: 'center',
          className: 'demo-table-info-column',
          key: 'difficulty_info'
        },
        {
          title: '工伤情况',
          width: 150,
          slot: 'occupational_info',
          align: 'center',
          className: 'demo-table-info-column',
          key: 'occupational_info'
        },
        {
          title: '卫健死亡情况',
          width: 150,
          key: 'decease_info',
          align: 'center',
          className: 'demo-table-info-column'
        },
        {
          title: '服刑情况',
          width: 150,
          key: 'criminal_info',
          align: 'center',
          className: 'demo-table-info-column'
        }
      ],
      itemPdfData: {
        fileList: [],
        fileName: '',
        filePath: ''
      },
      paramData: {
        file_url: ''
      },
      data7: [],
      verificationModal: false, // 各区核查情况模态框
      checkInfo: {}
    }
  },
  computed: {
    companyCode () {
      return this.$store.state.user.severUserInfo.company_code
    },
    bind_seller_login_code () {
      return this.$store.state.user.severUserInfo.bind_seller_login_code
    }
  },
  methods: {
    searchYDSJ (pageNo) { // 搜索疑点数据
      var param = {}
      if (this.loginName === 'LM07' || this.loginName === 'LM2249415') {
        param = {
          name: this.searchInfo.name,
          pageSize: this.currentPageSize,
          pageNo: pageNo,
          type: '0',
          citystr: this.searchInfo.county,
          subsidy_type: this.searchInfo.subsidy_type,
          subType: '疑点数据'
        }
      } else {
        param = {
          name: this.searchInfo.name,
          pageSize: this.currentPageSize,
          pageNo: pageNo,
          citystr: this.searchInfo.county,
          type: 0,
          subsidy_type: this.searchInfo.subsidy_type,
          subType: '疑点数据'
        }
      }
      this.statenum = '2'
      if (this.searchInfo.county === undefined || this.searchInfo.county === '' || this.searchInfo.county === null) {
        this.$Modal.error({
          title: '请选择区域'
        })
        return
      }
      findCompountList(param).then(ret => {
        if (ret.data.errcode === 0) {
          console.log(ret)
          this.data6 = ret.data.data.results
          this.totalnum = ret.data.data.totalRecord
        } else {
          this.$Modal.error({
            title: '错误',
            content: ret.data.errmsg
          })
        }
      })
    },
    searchPayableList () { // 可发放人员名单
      this.statenum = '0'
      let param = {
        pageSize: this.currentPageSize,
        pageNo: this.currentPageNo,
        subType: '发放数据'
      }
      findCompountList(param).then(ret => {
        if (ret.data.errcode === 0) {
          console.log(ret)
          this.data6 = ret.data.data.results
          this.totalnum = ret.data.data.totalRecord
        } else {
          this.$Modal.error({
            title: '错误',
            content: ret.data.errmsg
          })
        }
      })
    },
    // 疑点数据
    doubt (pageno) {
      this.statenum = '1'
      console.log(this.currentPageNo + 'qqqqqqqqqqqq' + this.currentPageSize)
      let param = {
        pageSize: this.currentPageSize,
        pageNo: this.currentPageNo,
        subsidy_type: '',
        subType: '疑点数据'
      }
      console.log(this.statenum, '~~2021~~~', this.statenum !== '1' ? 1 : 2)
      findCompountList(param).then(ret => {
        if (ret.data.errcode === 0) {
          console.log(ret)
          this.data6 = ret.data.data.results
          this.totalnum = ret.data.data.totalRecord
        } else {
          this.$Modal.error({
            title: '错误',
            content: ret.data.errmsg
          })
        }
      })
    },
    saveEdit () {
      this.loadData = true
      this.FileLoadData = '正在推送Excel表格文件>>>'
      uploadPEXexle({ 'xml_url': this.paramData.file_url }).then(ret => {
        if (ret.data.errcode === 0) {
          this.FileLoadData = ret.data.data
          this.loadData = false
        } else {
          this.FileLoadData = '推送失败: ' + ret.data.errmsg
          this.$Modal.error({
            title: '错误',
            content: ret.data.errmsg
          })
        }
      })
    },
    checkEdit () {
      this.loadData = true
      this.FileLoadData = '正在进行数据对比>>>'
      addDisabledGridInfo({}).then(ret => {
        if (ret.data.errcode === 0) {
          let text = ret.data.message
          this.FileLoadData = text
          this.paramData.dataFlag = true
          this.loadData = false
        } else {
          this.FileLoadData = '推送失败: ' + ret.data.errmsg
          this.$Modal.error({
            title: '错误',
            content: ret.data.errmsg
          })
        }
      })
    },
    addEdit () {
      this.loadData = true
      this.FileLoadData = '数据更新中>>>'
      addDisabledInfo({}).then(ret => {
        if (ret.data.errcode === 0) {
          this.FileLoadData = ret.data.msg
          this.loadData = false
        } else {
          this.FileLoadData = '推送失败: ' + ret.data.errmsg
          this.$Modal.error({
            title: '错误',
            content: ret.data.errmsg
          })
        }
      })
    },
    findinfo (param) { // 查看详情
      console.log(param, 'param')
      this.show1 = true
      getUserInfo({ 'cardno': param.cardno, 'subsidy_type': param.subsidy_type }).then(ret => {
        if (ret.data.errcode === 0) {
          this.mainmap = ret.data.data.mainmap
          this.usermap = ret.data.data.usermap
          console.log(this.mainmap)
        } else {
          this.$Modal.error({
            title: '错误',
            content: ret.data.errmsg
          })
        }
      })
    },
    disabilityShow (row) {
      return this.statenum !== '1' ? row.disability_type + ',' + row.disability_grade : row.disability_TYPE_NAME + ',' + row.disability_LEVEL
    },
    // 上传表单pdf前转base64
    beforeUploadPdf (file) {
      this.itemPdfData.fileName = file.name
      this.itemPdfData.filePath = 'disabilityPersonnelInfo'
      let that = this
      const reader = new FileReader()
      reader.readAsDataURL(file)
      reader.onload = () => {
        let index = reader.result.indexOf('base64,') + 7
        that.itemPdfData.file = reader.result.substring(index)
        that.upPicPdf(that.itemPdfData)
      }
      return false
    },
    // 上传表单pdf
    upPicPdf (obj) {
      var time = new Date().getTime()
      this.timeStep = time.toString()
      let param = {
        filePath: obj.filePath,
        fileName: obj.fileName,
        timestamp: this.timeStep
      }
      getSign(param).then(res => {
        if (res.data.errcode === 0) {
          createUpLoadFiles(res.data.data.docking_url, { sign: res.data.data.sign, timestamp: this.timeStep, filePath: obj.filePath, fileName: obj.fileName, file: obj.file }).then(res => {
            if (res.data.errcode === 0) {
              let pdfurl = res.data.data
              console.log(pdfurl)
              this.paramData.file_url = res.data.data
            } else {
              this.$Notice.error({ title: '上传失败', desc: res.data.data.msg })
            }
          })
        } else {
          this.$Notice.error({ title: '上传失败', desc: res.data.data.msg })
        }
      })
    },
    paymentafterwards (param) {
      let id = param.id
      let data2 = { 'id': id }
      if (confirm('确定追缴吗')) {
        PaymentAfterwards(data2).then(ret => {
          if (ret.data.errcode === 0) {
            this.init()
          } else {
            this.$Modal.error({
              title: '错误',
              content: ret.data.errmsg
            })
          }
        })
      }
    },
    renewalcollar (param) {
      let id = param.id
      let data2 = { 'id': id }
      if (confirm('确定续领吗')) {
        RenewalCollar(data2).then(ret => {
          if (ret.data.errcode === 0) {
            this.init()
          } else {
            this.$Modal.error({
              title: '错误',
              content: ret.data.errmsg
            })
          }
        })
      }
    },
    stop (param) {
      let id = param.id
      let data2 = { 'id': id }
      if (confirm('确定停发吗')) {
        updateStateByIdToStop(data2).then(ret => {
          if (ret.data.errcode === 0) {
            this.init()
          } else {
            this.$Modal.error({
              title: '错误',
              content: ret.data.errmsg
            })
          }
        })
      }
    },
    findlist () {
      console.log('名字：' + this.name)
      console.log('身份证：' + this.cardno)
      console.log('类型：' + this.model1)
      console.log('时间：' + this.dateTime)
      let state_time = date2str(this.dateTime[0])
      let end_time = date2str(this.dateTime[1])
      let state_time1 = date2str(this.dateTime1[0])
      let end_time1 = date2str(this.dateTime1[1])
      let data1 = {
        'name': this.name,
        'cardno': this.cardno,
        'subsidy_type': this.model1,
        'state_time': state_time,
        'end_time': end_time,
        'state_time1': state_time1,
        'end_time1': end_time1,
        'pageNo': this.pageNo,
        'pageSize': this.pageSize
      }
      findAllGrantUserList(data1).then(ret => {
        console.log('111111111111' + ret)
        if (ret.data.errcode === 0) {
          this.data6 = ret.data.data.results
          this.totalnum = ret.data.data.totalRecord
        } else {
          this.$Modal.error({
            title: '错误',
            content: ret.data.errmsg
          })
        }
      })
    },
    init (pageno) {
      this.statenum = ''
      // this.currentPageNo = 1
      let param = {
        pageSize: this.currentPageSize,
        pageNo: this.currentPageNo,
        name: this.searchInfo.name,
        subsidy_type: this.searchInfo.subsidy_type
      }
      console.log(this.county)
      findCompountMonthList(param).then(ret => {
        console.log(ret)
        if (ret.data.errcode === 0) {
          this.data6 = ret.data.data.results
          this.totalnum = ret.data.data.totalRecord
        } else {
          this.$Modal.error({
            title: '错误',
            content: ret.data.errmsg
          })
        }
      })
    },
    // 导出疑点数据
    exportData () {
      let param = {
        pageSize: 200000,
        pageNo: 1,
        subType: '疑点数据'
      }
      findCompountList(param).then(ret => {
        if (ret.data.errcode === 0) {
          console.log(ret)
          this.data7 = ret.data.data.results
          let today = new Date()
          this.$refs.table.exportCsv({
            filename: '疑点数据' + date2str(today),
            columns: this.columns7,
            data: this.data7.map((item, index) => {
              item.index = index + 1
              if (item.disability_type === '非残疾人') {
                item.disability_type = '非残疾人'
              } else {
                item.disability_type = item.disability_type + item.disability_grade
              }
              if (item.funeral_info === '1') {
                item.funeral_info = '查询到该人员殡葬信息'
              } else if (item.funeral_info === '3') {
                item.funeral_info = '对方接口不允许调用'
              } else if (item.funeral_info === '0') {
                item.funeral_info = '未查询到该人员殡葬信息'
              } else if (item.funeral_info === '2') {
                item.funeral_info = '调用失败'
              }
              if (item.subsidy_type === '护理补贴') {
                item.orphan_info = '护理补贴孤儿与否都满足条件'
              } else if (item.subsidy_type === '生活补贴') {
                if (item.orphan_info === '1') {
                  item.orphan_info = '孤儿'
                } else if (item.orphan_info === '0') {
                  item.orphan_info = '非孤儿'
                }
              }
              // if (item.orphan_info === '1') {
              //   item.orphan_info = '孤儿'
              // } else if (item.orphan_info === '0') {
              //   item.orphan_info = '非孤儿'
              // }
              if (item.difficulty_info === '0') {
                item.difficulty_info = '非领取特困供养补贴人员'
              } else if (item.difficulty_info === '1') {
                item.difficulty_info = '领取特困供养补贴人员'
              }
              if (item.occupational_info === '1') {
                item.occupational_info = '领取工伤补贴人员'
              } else if (item.occupational_info === '0') {
                item.occupational_info = '非领取工伤补贴人员'
              } else if (item.occupational_info === '2') {
                item.occupational_info = '查询失败'
              } else if (item.occupational_info === '3') {
                item.occupational_info = '对方接口不允许调用'
              }
              if (item.decease_info === '0') {
                item.decease_info = '未查询到死亡信息'
              } else if (item.decease_info === '1') {
                item.decease_info = '死亡时间' + item.decease
              }
              if (item.criminal_info === '0') {
                item.criminal_info = '非正在服刑人员'
              } else if (item.criminal_info === '1') {
                item.criminal_info = '查询到服刑信息' + item.criminal
              }
              return item
            }),
            original: false
          })
        } else {
          this.$Modal.error({
            title: '错误',
            content: ret.data.errmsg
          })
        }
      })
      // let today = new Date()
      // this.$refs.table.exportCsv({
      //   filename: '疑点数据' + date2str(today),
      //   columns: this.columns7,
      //   data: this.data7
      // })
    },
    check () { // 核查功能
      // this.Interval()
      // 获取当前日期
      var myDate = new Date()
      console.log(myDate.getDate())
      // if (myDate.getDate() < 29) {
      //   this.$Modal.error({
      //     title: '错误',
      //     content: '当前日期不可进行复核操作'
      //   })
      //   return
      // }
      console.log('开启定时任务')
      if (confirm('确定开始本月份核查吗???')) {
        createCheck().then(ret => {
          if (ret.data.errcode === 0) {
            console.log(ret)
            // 调用查询列表数量接口
            // this.Interval()
            // this.refresh()
          } else {
            this.$Modal.error({
              title: '错误',
              content: ret.data.errmsg
            })
          }
        })
      }
    },
    change (pageNo) {
      console.log(pageNo)
      if (this.statenum === '0') { // 可发放
        this.currentPageNo = pageNo
        this.currentPageSize = 10
        this.searchPayableList(this.currentPageNo)
      } else if (this.statenum === '1') { // 疑点
        this.currentPageNo = pageNo
        this.currentPageSize = 10
        this.doubt(this.currentPageNo)
      } else if (this.statenum === '') { // 历史数据
        this.currentPageNo = pageNo
        this.currentPageSize = 10
        this.init(this.currentPageNo)
      } else if (this.statenum === '2') {
        this.currentPageNo = pageNo
        this.searchYDSJ(this.currentPageNo)
      } else if (this.statenum === '3') { // 搜索历史数据
        this.currentPageNo = pageNo
        this.search(this.currentPageNo)
      }
    },
    refresh () {
      console.log('dingshi')
      // 已核查数量
      findNumUserd().then(ret => {
        if (ret.data.errcode === 0) {
          console.log(ret.data, '11111')
          this.compoundnum = ret.data.data.compoundnum
          console.log(this.compoundnum, '已核查')
        } else {
          this.$Modal.error({
            title: '错误',
            content: ret.data.errmsg
          })
        }
      })
      // 要核查数量
      getGrantNum().then(ret => {
        if (ret.data.errcode === 0) {
          console.log(ret)
          this.grantnum = ret.data.data.grantnum
          this.surplusCheckNum = this.grantnum - this.compoundnum
          this.num = this.grantnum - this.compoundnum
          if (this.surplusCheckNum === 0) {
            this.getCheckedList()
          }
        } else {
          this.$Modal.error({
            title: '错误',
            content: ret.data.errmsg
          })
        }
      })
    },
    // 查询核查后的数据
    getCheckedList () {
      var param = {
        pageSize: this.currentPageSize,
        pageNo: this.currentPageNo
      }
      findCompountList(param).then(ret => {
        if (ret.data.errcode === 0) {
          console.log(ret)
          this.data6 = ret.data.data.results
        } else {
          this.$Modal.error({
            title: '错误',
            content: ret.data.errmsg
          })
        }
      })
    },
    search (pageNo) {
      this.statenum = '3'
      var param = {}
      var url = ''
      if (this.companyCode === 'LM') {
        url = getMunicipalCompountList
        param = {
          name: this.searchInfo.name,
          subsidy_type: this.searchInfo.subsidy_type,
          citystr: this.searchInfo.county,
          pageNo: pageNo,
          pageSize: 10
        }
      } else {
        url = findCompountMonthList
        param = {
          name: this.searchInfo.name,
          subsidy_type: this.searchInfo.subsidy_type,
          pageNo: pageNo,
          pageSize: 10
        }
      }
      url(param).then(ret => {
        console.log(ret)
        if (ret.data.errcode === 0) {
          this.data6 = ret.data.data.results
          this.totalnum = ret.data.data.totalRecord
        } else {
          this.$Modal.error({
            title: '错误',
            content: ret.data.errms
          })
        }
      })
    },
    areaCode () {
      let param = {
        'pid': '0'
      }
      getSubordinate(param).then(ret => {
        this.code = ret.data.data.list
        console.log(ret.data.data, 'sssss', this.code)
      })
    },
    clearData () {
      this.searchInfo = {}
      this.init()
    },
    verification () { // 各区核查情况
      console.log('各区核查情况')
      this.getCheckInfo()
      this.verificationModal = true
    },
    getCheckInfo () { // 各区核查情况
      findCheckList().then(ret => {
        if (ret.data.errcode === 0) {
          console.log(ret, '核查情况')
          this.checkInfo = ret.data.data
          // 调用查询列表数量接口
          // this.Interval()
          // this.refresh()
        } else {
          this.$Modal.error({
            title: '错误',
            content: ret.data.errmsg
          })
        }
      })
    }
  },
  watch: {
    select1 (str) {
      var obj = JSON.parse(str)
      this.searchInfo.county = obj.title
      findAllCityList({ id: obj.id }).then(res => {
        this.streetList = res.data.data
        console.log(this.streetList)
      })
    },
    select2 (val) {
      this.searchInfo.township = val
    },
    surplusCheckNum () {
      console.log('~~~~~~')
    }
  },
  mounted () {
    this.todayDate = new Date().getDate()
    console.log(this.todayDate, '~~~~~')
    this.init()
    this.areaCode()
    this.loginName = this.$store.state.user.severUserInfo.loginName
  }
}
</script>
